import {NgModule} from '@angular/core';
import {RouterEvent, RouterModule, Routes} from '@angular/router';
import {HeroesComponent} from './heroes/heroes.component';
import {DashboardComponent} from './dashboard/dashboard.component';
import {HeroDetailComponent} from './hero-detail/hero-detail.component';
import {StoreComponent} from "./store/store.component";
import {LoginComponent} from "./login/login.component";
import {CategoryDetailComponent} from "./category-detail/category-detail.component";
import {BackviewComponent} from "./backview/backview.component";
import {UsermComponent} from "./userm/userm.component";
import {CategorymComponent} from "./categorym/categorym.component";
import {GoodsmComponent} from "./goodsm/goodsm.component";
import {OrdermComponent} from "./orderm/orderm.component";


const routes: Routes = [
  {path: 'heroes', component: HeroesComponent},
  {path: 'dashboard', component: DashboardComponent},
  {path: 'store', component: StoreComponent},
  {path: 'login', component: LoginComponent},
  {path: 'back', component: BackviewComponent},
  {path: 'userm', component: UsermComponent, },
  {path: 'categorym', component: CategorymComponent, },
  {path: 'goodsm', component: GoodsmComponent, },
  {path: 'orderm', component: OrdermComponent, },
  {path: '', redirectTo: '/login', pathMatch: 'full'},
  {path: 'detail/:id', component: HeroDetailComponent},
  {path: 'category/:id', component: CategoryDetailComponent},
];

@NgModule({
  exports: [RouterModule],
  imports: [RouterModule.forRoot(routes)],
})
export class AppRoutingModule {
}

